<template>
  <view class="content"><!--  box_container -->
  <view class="top">
    <image class="logo" src="/static/logo.png"></image>
    <view class="text-area">
      <text class="title">{{title}}</text>
    </view>
	<view class="description">{{description}}</view>
	</view>
	<view class="bottom">
		<view class="bottom_box">
		<view class="content">{{content}}</view>
		</view>
	</view>
    <!-- <button @click="toLogin" >跳转登录页</button> -->
  </view>
</template>

<script>
import {navigateToMy,redirectToMy, switchTabMy} from "@/util/uniUtils";
import {postAction} from "@/util/api.js"
export default {
  data() {
    return {
      title: '农检通',
	  description:'食用农产品合格证管理系统',
	  content:'专业解决食用农产品合格证出具，获取，传输和追溯问题，确保交易合格'
    }
  },
  onLoad() {
	setTimeout(()=>{
		// 检查token是否有效，并刷新token时长
        postAction("/api/user/refreshToken").then(res => {
            if (res.code == 200) {
                // token有效，进入home页面
                switchTabMy('/pages/tabbar/home')
            } else {
                // 进入登录页面
                redirectToMy("/subPackages/user/login")
            }
        })

	}, 2000)
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.top{
	height: 70vh;
	text-align: center;
}
.logo {
  height: 200rpx;
  width: 200rpx;
  //margin: 200rpx auto 50rpx;
  margin-top: 28vh;
}

.text-area {
  display: flex;
  align-items: center;
  justify-content: center;
}

.title {
  font-size: 55rpx;
  color: #00b54e;
   margin: 50rpx auto;
}
.description{
	font-size: 40rpx;
	color: #00b54e;
}
.bottom{
	background-color: #00b54e;
	height:30vh;
	width: 100%;
	text-align: center;
}
.bottom_box{
	width: 80%;
	margin: 0 auto;
	padding-top:150rpx;
}
.content{
	color: white;
	font-size: 35rpx;

}
</style>
